import { defineUserConfig } from 'vuepress'
import { viteBundler } from '@vuepress/bundler-vite'
import { plumeTheme } from 'vuepress-theme-plume'
import * as path from 'node:path'
import {zhNotes} from "./notes";

export default defineUserConfig({
    // 请不要忘记设置默认语言
    lang: 'zh-CN',
    title: '蜗牛',
    description: '个人博客',
    source: path.resolve(__dirname, '../'),
    public: path.resolve(__dirname, 'public'),

    //网站title图片(favicon)
    head: [
        ['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/images/favicon-32x32-0.png' }],
        ['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: '/images/favicon-16x16-0.png' }],
    ],

    pagePatterns: ['**/*.md', '!**/*.snippet.md', '!.vuepress', '!node_modules'],

    theme: plumeTheme({
        logo: '/images/logo_12.png',
        logoDark:'/images/logo_12.png',
        //用户信息
        profile: {
            url: '/images/avatar.jpeg',
            name: '蜗牛',
            description: '反者道之动，弱者道之用。',
            circle: true,
            location: '深圳，中国',
            organization: '',
        },

        //文章目录层级，页面设置会覆盖这里配置
        outline:'deep',

        notes: zhNotes,

        //导航栏配置
        navbar: [
            {text: '首页', link: '/', icon: 'material-symbols:home-outline'},
            {text: '指南', icon: 'icon-park-outline:guide-board', link: '/guide/intro/', activeMatch: '^/guide/',},
            {text: '博客', link: '/blog/', icon: 'material-symbols:article-outline', activeMatch: '^/(blog|article)/',},
            {
                text: '其他',
                link: '/notes/other/miscellaneousnotes/文字转语音.md',
                icon: 'material-symbols:other-admission',
                activeMatch: '^/miscellaneousnotes/'
            },
            {
                text: '知识',
                icon: 'material-symbols:school',
                items: [
                    {text: '毛泽东选集', link: '/maoxuan/one/', activeMatch: '^/maoxuan/'},
                    {text: '摄影', link: '/photography/ozppyk1r/',activeMatch: '^/photography/'},
                    {text: 'Goland', link: '/goland/vzw5cxop/',activeMatch: '^/goland/'},
                    {text: 'Python', link: '/python/g4ywnesu/',activeMatch: '^/python/'},
                ],
            },
        ],

        //右侧配置
        social: [

        ],

        //底部标注来源
        footer: { message:'',copyright: 'Copyright © 2024-present WoNiu' },

        navbarSocialInclude:[''],

        //encrypt加密配置
        encrypt:{
            rules:{
                '/article/uddgk2au/':'vpn96321...',
                '^/maoxuan/':'maoxuan123',
                '^/goland/':'goland123...',
                '/article/p7setsae/':'huigerensuibi26.',
            },
        },

        //博客配置
        blog:{
            link:'/blog/',
            pagination: {
                perPage: 15,
            },
            tags:true,
            archives:true
        },

        plugins: {
            frontmatter: { exclude: ['**/*.snippet.*'] },

           //代码高亮
            shiki: {
                twoslash: true,
                lineNumbers: 10,
                languages: ['sh', 'ts', 'md', 'html', 'js', 'go', 'kotlin', 'rust', 'vue', 'css', 'json', 'scss', 'yaml', 'bash', 'c++', 'java', 'py', 'ruby', 'make', 'objc', 'swift', 'php', 'rs', 'sql', 'xml', 'zig', 'pug', 'http', 'less', 'styl', 'jsx', 'tsx', 'astro', 'svelte', 'wasm', 'vb', 'bat', 'cs', 'cpp', 'mermaid'],
            },

            markdownEnhance: {
                demo: true,
                include: true,
                chart: true,
                echarts: true,
                mermaid: true,
                flowchart: true,
            },
            markdownPower: {
                pdf: true,
                caniuse: true,
                plot: true,
                bilibili: true,
                youtube: true,
                icons: true,
                codepen: true,
                replit: true,
                codeSandbox: true,
                jsfiddle: true,
                repl: {
                    go: true,
                    rust: true,
                    kotlin: true,
                },
            },

            comment: {
                provider: 'Giscus',
                comment: true,
                repo: 'pengzhanbo/vuepress-theme-plume',
                repoId: 'R_kgDOG_ebNA',
                category: 'docs-comment',
                categoryId: 'DIC_kwDOG_ebNM4Cd0uF',
                mapping: 'pathname',
                reactionsEnabled: true,
                inputPosition: 'top',
                darkTheme: 'dark_protanopia',
                lightTheme: 'light_protanopia',
            },

            watermark: {
                enabled: false,
                watermarkOptions: {
                    content: 'vuepress-theme-plume',
                },
            },

        },
    }),
    bundler: viteBundler()
})